package com.fixed.controller;

import com.fixed.annotation.RateLimitByLua;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.fixed.annotation.RateLimit;
import com.fixed.enums.LimitType;

@RestController
@RequestMapping("/test")
public class TestController {

    @RateLimit(time = 10, count = 2, limitType = LimitType.IP)
    @GetMapping("/hello")
    public String hello() {
        return "hello world";
    }

    @RateLimitByLua(time = 10, count = 2, limitType = LimitType.IP)
    @GetMapping("/helloByLua")
    public String helloByLua() {
        return "hello world";
    }
}
